Skip to main content

All Questions

2votes
0answers
1kviews

Many-readers-one-writer with semaphores and multithreading

I've been looking for a solution to the may readers one writer in Java. I was intrigued by this question posted here and I read the Wikipedia entry about it. So far, I've reached a fine solution, or ...
Oscar Besga Panel's user avatar
3votes
3answers
5kviews

Running multiple producer and single consumer in a multithread environment

I have a below class in which add method will be called by multiple threads to populate messageByChannelReference concurrent ...
user1950349's user avatar
6votes
1answer
868views

Consumer/Producer (Concurrency) - Exception Handling

I have a circular buffer (array/first in first out), a consumer and a producer. A producer puts random numbers into the array, and a consumer takes the first number and checks if it is relative prime. ...
racc44's user avatar
1vote
2answers
1kviews

One producer and multiple consumers wherein the producer has to wait until all consumers finish before adding more data

I am trying to solve the scenario involving 1 producer and 5 consumers. The producer puts data to queue and waits till all consumers have finished before adding more data. Please review and let me ...
AnjuG's user avatar
1vote
1answer
500views

Multithreaded Producer-Consumer pattern

I have Producer Threads A, B and C producing 3 different types of events Events A, B and C respectively. The Consumer thread can ...
Sabarish's user avatar
3votes
4answers
24kviews

Reader-writers problem using semaphores in Java

I have written my own solution to the Reader-Writers problems using semaphores based on the psuedocode from Wikipedia. I would like to gauge the correctness and quality of the code. ...
tsaebeht's user avatar
2votes
1answer
2kviews

Message queue with multiple producer, single consumer and no duplicates

I had to make a message queue in an android app which my thread takes messages from and processes them. There can be multiple producers and duplicate messages should be avoided. Rate of insertion is ...
Dexter's user avatar
2votes
0answers
106views

Porting Java semaphore to MacOSX

I wanted to write some more JNI code and decided to (re)implement a semaphore for MacOSX. In order to assert somehow correctness of my implementation I hereby supply a (multi)consumer/(multi)producer ...
coderodde's user avatar

close